package com.hd.openapi.web.cotenollen;

import com.hd.openapi.common.ResponseResult;
import com.hd.openapi.common.ResultTable;
import com.hd.openapi.entity.UserToken;
import com.hd.openapi.servies.tokenser;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultType;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/token")
public class tokenconll {
    @Autowired
    private tokenser ts;

    @RequestMapping("/table")
    private ResultTable table(@RequestParam(defaultValue = "1") Integer page,
                              @RequestParam(defaultValue = "10") Integer limit,
                              String accessToken){
        return  ts.gettokendata(page,limit,accessToken);
    }
    @RequestMapping("/add")
    public ResponseResult add(UserToken userToken){

        System.out.println ("afdhvfdg vadaljkfkjakh");

        return ts.adddata(userToken);
    }
    @RequestMapping("/update")
    public ResponseResult updata(UserToken userToken){
        return ts.updatada(userToken);
    }
    @RequestMapping("/del")
    public ResponseResult del(Integer[] ids){
        return ts.deldata(ids);
    }
}
